<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
 <head>
  <title> string similarity </title>
  <script type="text/javascript" src="levenshtein.js"></script>
 <script type="text/javascript">
 var string2find = "Adenosine-3',5'-monophosphate-8-Chloro (8-Chloro-cAMP)";
 var compareAgains = ["8-Chloro-cAMP", "Adenosine"];
 
 //matlab sintax, as always
 var a = levenshtein (string2find, compareAgains[0]);
  var b = levenshtein (string2find, compareAgains[1]);
  console.log(a+" "+b);

  var patternSplit = function (s1, patt) {
	//split the first (to match) string
	if(patt=='()'){
		var m = s1.match(/\((.*)\)/);
		if(m){
			//find the one with the largest lev distane and return that one
			 return m[1]
		}
	}
  }
 
 </script>
 
 </head>

 <body>
  
 </body>
</html>
